# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="3"

inherit git-2 eutils

#DESCRIPTION="dmd D Programming Language compiler"
DESCRIPTION="Reference compiler for the D programming language"

HOMEPAGE="http://www.digitalmars.com/d/"
EGIT_REPO_URI="git://github.com/D-Programming-Language/dmd.git"

LICENSE="DMD"
SLOT="2"
KEYWORDS="~x86 ~amd64"
IUSE=""
EAPI="3"

RESTRICT="mirror"

DEPEND="sys-apps/findutils
	!dev-lang/dmd-bin:2"

PDEPEND="app-admin/eselect-dmd"

S="${WORKDIR}/${PN}"

src_compile() {
	cd "${S}/src"
	ln -s . mars
	make -f posix.mak || die "make failed"
}

src_install() {
	doman "${S}/docs/man/man1/dmd.1" || die "man install failed"
	doman "${S}/docs/man/man1/dmd.conf.5" || die "man install failed"
	newbin "${S}/src/dmd" dmd2.bin || die "bin install failed"
	dobin "${FILESDIR}/dmd.dmd2-phobos" || die "script install failed"
}
